using UnityEngine;
using System.Collections;

public class Fail : MonoBehaviour {
	
	public GameObject Playercubetop;
	public GameObject Playercubemiddle;
	public GameObject PlayercubeBottom;
	public AudioSource Boom;
	// Use this for initialization
	void Start () {
	
		
	}
	
	// Update is called once per frame
	void Update () {
		
		if(Playercubetop == false && Playercubemiddle == false && PlayercubeBottom == false)
		{
			Application.LoadLevel(6);		
		}	
	
	}
	void OnCollisionEnter(Collision collision)
	{
		
		if(Playercubetop == true)
		{
		Object.Destroy(Playercubetop);
		audio.Play();
		}
		if(Playercubetop == false && Playercubemiddle == true)
		{
		Object.Destroy(Playercubemiddle);
		audio.Play();
		}
		if(Playercubetop == false && Playercubemiddle == false && PlayercubeBottom == true)
		{
		Object.Destroy(PlayercubeBottom);
		audio.Play();
		}
		
	}
}
